package com.xtgg.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.Adapter;
import android.widget.LinearLayout;

public class CustomListView extends LinearLayout {

	private Adapter adapter;

	public void bindLinearLayout() {
		int count = adapter.getCount();

		for (int i = 0; i < count; i++) {
			View v = adapter.getView(i, null, null);
			v.setTag(i);
			addView(v, i);
		}
	}

	public CustomListView(Context context) {
		super(context);

	}

	public CustomListView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public Adapter getAdpater() {
		return adapter;
	}

	public void setAdapter(Adapter adpater) {
		this.adapter = adpater;
		bindLinearLayout();
	}

}
